<%--
  Created by IntelliJ IDEA.
  User: pc
  Date: 2021/5/25
  Time: 15:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="../css/pagehome.login.css">
    <script type="application/javascript" src="../js/jquery-3.3.1.js"></script>
    <script type="application/javascript" src="../js/bootstrap.min.js"></script>
    <script type="application/javascript" src="../layui/layui.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<form class="layui-form" action="" lay-filter="example">
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <input type="hidden" name="id" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input" value="${user.id}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">tel</label>
        <div class="layui-input-block">
            <input type="text" name="tel" placeholder="请输入tel" autocomplete="off" class="layui-input"value="${user.tel}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">password</label>
        <div class="layui-input-block">
            <input type="password" name="password" lay-verify="title" autocomplete="off" placeholder="密码" class="layui-input" value="${user.password}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">email</label>
        <div class="layui-input-block">
            <input type="text" name="email" lay-verify="title" autocomplete="off" placeholder="请输入email" class="layui-input" value="${user.email}">
        </div>
    </div>



    <div class="layui-form-item">
        <div class="layui-input-block">

            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">修改</button>
        </div>
    </div>
</form>
<script >
    layui.use(['form', 'layedit', 'laydate'], function(){

        var form = layui.form;




        //监听提交
        form.on('submit(demo1)', function(data){
          $.ajax({
              url:'/user/updateuser',
              type:'post',
              data:JSON.stringify(data.field),
              contentType:'application/json',
              dataType:'json',
              success:function (res) {
                  alert(2222)
                window.location.href=("../user/selectAll")
              }

          });
            return false;
        });


    });
</script>
</body>
</html>
